# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=petools
pkgver=1.9.762
pkgrel=3
pkgdesc='Portable executable (PE) manipulation toolkit.'
url='https://github.com/petoolse/petools'
groups=('blackarch' 'blackarch-windows')
license=('MIT')
arch=('any')
makedepends=('git')
source=("https://github.com/petoolse/petools/releases/download/v$pkgver/PE.Tools.v$pkgver.2018.7z")
sha512sums=('31f00c80683211bf487bd8a3d391be0614f7d270abe70dad37f5f51e43282fe0d904743ce8962ce62a8834f2a9d5cd2eb7dd184fc0d743647ae8ebe462bac87e')

pkgver() {
	ver=$(curl -s -D- 'https://github.com/petoolse/petools/releases/latest' |
  sed -n 's#Location:.*/tag/##p' | sed 's/v//' | tr -d '\n\r')

  echo $ver
}

package() {
  rm -rf "PE.Tools.v$pkgver.2018.7z"

  install -dm 755 "$pkgdir/usr/share/windows/$pkgname"

  cp -a * "$pkgdir/usr/share/windows/$pkgname/"
}

